<template>
    <div id="vmodel">
      <input type="text" v-model="name"/>

      <form action="#">
        <input type="text" id="username" v-model="user.uname"/>
        <input type="text" id="password" v-model="user.upwd"/>
        <input type="submit" v-on:click="submit" value="注册"/>
      </form>
    </div>
</template>

<script>
    export default {
        name: "vmodel",
      data(){
          return{
            name:'黑马程序员',
            user:{uname:'',upwd:''}
          }
      },
      methods:{
          submit:function () {
            alert(" username= "+ this.user.uname + " password="+this.user.upwd);
          }
      }
    }
</script>

<style scoped>

</style>
